<template>
  <div class="splitting-pool-bg">
    <NormalForm :operateForm="operateForm" :formList="formList" :enumOpt="enumOpt" pageName="规则池">
      <template slot="myRadio">
        <div style="margin-bottom: 20px;">
          <el-radio-group v-model="operateForm.searchType">
            <el-radio label="1">常规搜索</el-radio>
            <el-radio label="2">查看无效规则(规则内有专员离职)</el-radio>
          </el-radio-group>
          <span v-if="operateForm.searchType == '2' && isHandle" class="top-msg">
            <i class="el-icon-warning"></i>
            您有 <span style="color: dodgerblue;">{{count}}</span> 条失效规则
          </span>
        </div>
      </template>
    </NormalForm>
    <el-card class="my-normal-table-bg">
      <div slot="header" class="page-title">
        <div class="title-icon"></div>
        <span>查询结果</span>
      </div>
      <el-row :gutter="20" class="search-result-list">
        <template v-for="(item, index) in blockList">
          <el-col v-if="true" :span="12" :key="index">
            <NormalBlock class="search-result-item" :blockData="item"></NormalBlock>
          </el-col>
        </template>
      </el-row>
    </el-card>
  </div>
</template>

<script>
import NormalForm from "../components/normalForm.vue";
import NormalBlock from "../components/normalBlock.vue";

export default {
  name: 'SplittingPool',
  components: {
    NormalForm,
    NormalBlock
  },
  data() {
    return {
      // 表单
      operateForm: {
        comCode: '',
        parentCode: '',
        dividerCode: '',
        contNo: '',
        searchType: '1',
      },
      formList: [
        {
          label: '机构',
          value: null,
          prop: 'comCode',
          type: 'SELECT',
          emunName: 'comList'
        },
        {
          label: '行政区域',
          value: null,
          prop: 'parentCode',
          type: 'SELECT',
          emunName: 'parentList'
        },
        {
          label: '分单区域',
          value: null,
          prop: 'dividerCode',
          type: 'SELECT',
          emunName: 'dividerList'
        },
        {
          label: '分单规则号',
          value: null,
          prop: 'contNo',
          type: 'INPUT',
          emunName: null
        },
      ],
      enumOpt: {
        comList: [],
        parentList: [],
        dividerList: []
      },
      isHandle: false,
      count: 88,
      blockList: [
        {
          ruleNo:'9100001',
          address: '江苏省无锡市滨湖区',
          commissionerList: [
            {
              name: '王艳（无锡续收一组）',
              percent: '100%',
              threshold: '150-800',
            }
          ],
          place: '滨湖区华庄',
          state: '2'
        },
        {
          ruleNo:'9100002',
          address: '江苏省无锡市滨湖区',
          commissionerList: [
            {
              name: '陈艳（无锡续收一组）',
              percent: '30%',
              threshold: '100-500',
            },
            {
              name: '王彩营（无锡续收一组）',
              percent: '70%',
              threshold: '150-800',
            }
          ],
          place: '滨湖区雪浪',
          state: '1'
        },
        {
          ruleNo:'9100003',
          address: '江苏省无锡市北塘区',
          commissionerList: [
            {
              name: '王晨（无锡续收一组）',
              percent: '50%',
              threshold: '100-500',
            },
            {
              name: '刘兰兰（无锡续收一组）',
              percent: '50%',
              threshold: '100-500',
            }
          ],
          place: '北塘区黄巷镇',
          state: '1'
        },
        {
          ruleNo:'9100004',
          address: '江苏省无锡市滨湖区',
          commissionerList: [
            {
              name: '朱小栋（无锡续收一组）',
              percent: '100%',
              threshold: '200-800',
            },
          ],
          place: '滨湖区南方泉',
          state: '2'
        },
        {
          ruleNo:'9100005',
          address: '江苏省无锡市滨湖区',
          commissionerList: [
            {
              name: '顾晓宇（无锡续收一组）',
              percent: '50%',
              threshold: '100-500',
            },
            {
              name: '何也（无锡续收一组）',
              percent: '50%',
              threshold: '100-500',
            },
          ],
          place: '滨湖区葛軚桥',
          state: '1'
        },
        {
          ruleNo:'9100006',
          address: '江苏省无锡市北塘区',
          commissionerList: [
            {
              name: '张晓梦（无锡续收二组）',
              percent: '30%',
              threshold: '100-500',
            },
            {
              name: '李画（无锡续收二组）',
              percent: '70%',
              threshold: '150-800',
            },
          ],
          place: '北塘区通惠路',
          state: '1'
        },
      ]
    }
  },
  mounted() {},
  methods: {},
}
</script>

<style lang="scss" scoped>
.splitting-pool-bg{
  .top-msg{
    font-size: 16px;
    margin-left: 20px;
    color: orange;
    i{
      font-size: 20px;
      margin-right: 6px;
    }
  }
  .my-normal-table-bg {
    padding: 16px;
    margin-top: 20px;
    .page-title {
      display: flex;
      align-items: center;
      font-size: 18px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      color: #2a2a2a;
      margin-left: 10px;
      .title-icon {
        width: 8px;
        height: 22px;
        background-color: #082aff;
        margin-right: 10px;
      }
    }
    .search-result-list{
      width: 100%;
      .search-result-item{
        margin-bottom: 20px;
      }
    }
    ::v-deep.el-card__header {
      padding: 8px 0 10px 0;
      border: 0;
    }
  }
}
</style>
